﻿Public Class PhoneNumber

    Property id As Long

    Property areaCode As String
    Property prefix As String
    Property lineNumber As String
    Property ext As String
    Property type As String

    Sub New()
        Me.New("", "", "", "")
    End Sub

    Sub New(ac As String, prefix As String, ln As String, type As String)
        Me.New(-1, ac, prefix, ln, type)
    End Sub

    Sub New(id As Long, ac As String, prefix As String, ln As String, type As String)
        Me.id = id
        Me.areaCode = ac
        Me.prefix = prefix
        Me.lineNumber = ln
        Me.type = type
        Me.ext = ""
    End Sub

    Function isNew() As Boolean
        Return (Me.id = -1)
    End Function

    Public ReadOnly Property displayName As String
        Get
            Return "(" & Me.areaCode & ") " & prefix & " - " & lineNumber
        End Get
    End Property
End Class
